package cn.lysy.xiaoruan.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import cn.lysy.xiaoruan.MainActivity;
import cn.lysy.xiaoruan.R;
import cn.lysy.xiaoruan.base.BaseActivity;

public class HomeActivity extends BaseActivity {

    private ImageButton back;
    private Button login;
    private TextView reg;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        back= (ImageButton) findViewById(R.id.login_back);
        login= (Button) findViewById(R.id.bt_login);
        reg= (TextView) findViewById(R.id.reg);

        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(HomeActivity.this, MainActivity.class);
                startActivity(intent);
            }
        });

        login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(HomeActivity.this,MainActivity.class);
                intent.putExtra("loginid",1);
                startActivity(intent);
            }
        });

        reg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(HomeActivity.this,RegActivity.class);
                startActivity(intent);
            }
        });
    }
}
